<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
<div class="container mt-5" style="max-width: 400px;">
    <h3 class="mb-4">用户注册</h3>
    <form method="post">
        {% csrf_token %}
        <div class="mb-3">
            <label for="username" class="form-label">用户名</label>
            <input type="text" name="username" class="form-control" required>
        </div>
        <div class="mb-3">
            <label for="password" class="form-label">密码</label>
            <input type="password" name="password" class="form-control" required>
        </div>
        <button type="submit" class="btn btn-success w-100">注册</button>
    </form>
    {% if error %}
        <div class="alert alert-danger mt-3">{{ error }}</div>
    {% endif %}
    <p class="mt-3 text-center"><a href="{% url 'login' %}">已有账号？去登录</a></p>
</div>
</body>
</html>
